package com.yiqi.lottery.feature.find.model;

import com.suozhang.framework.component.http.RxDataProcessFactory;
import com.suozhang.framework.entity.bo.PageData;
import com.yiqi.lottery.entity.bo.CircleBo;
import com.yiqi.lottery.entity.bo.FindScoreBo;
import com.yiqi.lottery.feature.find.contract.CircleContract;
import com.yiqi.lottery.feature.find.contract.LiveContract;
import com.yiqi.lottery.feature.find.dependencies.circle.DaggerCircleModelComponent;
import com.yiqi.lottery.feature.find.dependencies.live.DaggerLiveModelComponent;
import com.yiqi.lottery.framework.api.ApiLib;
import com.yiqi.lottery.framework.api.FindApi;
import io.reactivex.Observable;

import javax.inject.Inject;

public class LiveModel implements LiveContract.Model {

    @Inject
    FindApi api;


    @Inject
    public LiveModel() {

        DaggerLiveModelComponent.builder().apiComponent(ApiLib.apiComponent()).build().inject(this);
    }


    @Override
    public Observable<FindScoreBo> getScoreLive(int type) {
        return api.getScoreLive(type).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }

}
